package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum LoanTypeForPrizeEnum {
    SOCIAL_SECURITY_LOAN(LoanTypeEnum.SOCIAL_SECURITY_LOAN.getValue(),7),
    CREDIT_CARD_LOAN(LoanTypeEnum.CREDIT_CARD_LOAN.getValue(),8),
    HOUSE_MORTGAGE_LOAN(LoanTypeEnum.HOUSE_MORTGAGE_LOAN.getValue(),9),
    VEHICLE_MORTGAGE_LOAN(LoanTypeEnum.VEHICLE_MORTGAGE_LOAN.getValue(),0),
    SUPPLY_CHAIN_LOAN(LoanTypeEnum.SUPPLY_CHAIN_LOAN.getValue(),0),
    SPEED_LOAN(LoanTypeEnum.SPEED_LOAN.getValue(), 0),
    OTHER_LOAN(LoanTypeEnum.OTHER_LOAN.getValue(),0),
    CONSUME_LOAN(LoanTypeEnum.CONSUME_LOAN.getValue(),11),
    BUSINESS_LOAN(LoanTypeEnum.BUSINESS_LOAN.getValue(),12);



    private final Byte value;
    private final Integer userPrizeSuitProjectType;// 参照com.niiwoo.activity.stage.enums.prize.UserPrizeSuitProjectTypeEnum, 若没有对应的则为0

    public static LoanTypeForPrizeEnum enumOf(Byte value) {
        for (LoanTypeForPrizeEnum typeEnum : values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("LoanTypeEnum:" + value);
    }
}
